package com.hfast.fakenotification;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;

import com.hfast.fakenotification.R;

public class DisplayNewMessage extends Activity {

    public static final String TEXT_STAT = "TextStatus";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent intent = getIntent();
        String message = intent.getStringExtra(Main.EXTRA_MESSAGE);
        String sender = intent.getStringExtra(Main.EXTRA_SENDER);
        setTitle(sender);

        setContentView(R.layout.activity_display_new_message);
//        SharedPreferences textStat = getSharedPreferences(TEXT_STAT, 0);
//        SharedPreferences.Editor editor = textStat.edit();
//        editor.putBoolean("isThereText", false);
//        editor.commit();

        ((TextView)findViewById(R.id.incoming_textview)).setText(message);
        System.out.println("creating text");
    }


    @Override
    protected void onResume() {
        super.onResume();
        System.out.println("resuming text");

    }

    @Override
    protected void onStop() {
        super.onStop();
        System.out.println("stopping text");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        System.out.println("destroying text");

    }

    @Override
    protected void onStart() {
        super.onStart();
        System.out.println("starting text");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        System.out.println("restarting text");
    }

    @Override
    protected void onPause() {
        super.onPause();
        System.out.println("pausing text");

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.display_new_message, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }


}
